#pragma once

#include <openssl/ssl.h>

#define CHAT_PORT 6789

// Diffie-Hellman key negotiation parameters (don't be afraid, this is generated autometically)

static DH *get_dh() {
  static unsigned char dh1024_p[]={
    0xB1,0x09,0x75,0x72,0xCF,0x73,0x00,0x6E,0x3B,0x5F,0xC2,0xA7,
    0x06,0x5D,0x65,0x41,0x9C,0x27,0x0D,0x8F,0xFB,0x36,0xA8,0x10,
    0x2C,0xF5,0x68,0x90,0x53,0x6A,0x5E,0xB0,0x23,0x51,0xF6,0x69,
    0x04,0x5D,0xBB,0x76,0xA6,0x92,0xFB,0xA2,0xD2,0xB0,0x27,0x97,
    0x0A,0x19,0xD3,0xCF,0x03,0x30,0xB5,0xB7,0x15,0xF3,0x55,0xEF,
    0x5B,0x82,0xF3,0xC9,0xF3,0x9D,0x36,0x68,0x21,0x58,0xF9,0xE2,
    0xA3,0x3E,0x89,0xA3,0x6D,0x7F,0xA3,0x4A,0x2E,0x17,0x1E,0x17,
    0xAF,0xC3,0x2A,0x35,0x60,0xEB,0xFA,0x52,0x7B,0x7D,0xAC,0x7B,
    0xA1,0x5C,0xFC,0x4A,0xD5,0xA6,0x62,0x08,0x10,0x75,0xAB,0x48,
    0xDB,0x14,0x7F,0x9D,0x61,0xE4,0xBF,0xBC,0x8A,0x89,0x0B,0x0C,
    0x81,0x60,0x28,0x4F,0x7F,0x94,0xCA,0x5B,
  };
  static unsigned char dh1024_g[]={
    0x02,
  };
  DH *dh;

  if ((dh=DH_new()) == NULL) return(NULL);
  dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
  dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
  if ((dh->p == NULL) || (dh->g == NULL))
    { DH_free(dh); return(NULL); }
  return(dh);
}
